package com.example.service.impl;

import java.util.List;

import com.example.entity.SysUser;
import com.example.repository.SysUserRepository;
import com.example.service.ISysUserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 系统用户  服务实现类
 * </p>
 *
 * @author lilufeng
 * @since 2016-12-08
 */
@Service
public class SysUserServiceImpl implements ISysUserService {
	
	@Autowired
	private SysUserRepository sysUserRepository;

	@Override
	public SysUser add(SysUser sysUser) {
		return sysUserRepository.save(sysUser);
	}

	@Override
	public List<SysUser> getUsers() {
		return (List<SysUser>) sysUserRepository.findAll();
	}

	@Override
	public SysUser findByUsername(String username) {
		return sysUserRepository.findByUsername(username);
	}
	
}
